package practice;

public class PraticeDay5 {
    public static void main(String[] args) {
        int[] num={2,3,5,23,5,98,12};
        int max=getMaxOfArrays(num);
        System.out.println("最大值为"+max);
        for(int i = 0 ;i<num.length;i++){
            System.out.print(" "+num[i]);
        }
    }

    public static int getMaxOfArrays(int[] a){
        int max=a[0];
        for(int i=0;i<a.length;i++){
            if(max<a[i]){
                max=a[i];
            }
        }
        return max;
    }
}
